package myaction.login;

import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

/**
 * first way of obtaining request, session and application
 * @author rex
 *
 */
public class LoginAction1 extends ActionSupport {

	private Map<String, Object> myRequest;
	private Map<String, Object> mySession;
	private Map<String, Object> myApplication;

	@SuppressWarnings("unchecked")
	public LoginAction1() {
		myRequest = (Map<String, Object>) ActionContext.getContext().get(
				"request");
		mySession = ActionContext.getContext().getSession();
		myApplication = ActionContext.getContext().getApplication();
	}

	public String execute() {
		myRequest.put("r1", "r1");
		mySession.put("s1", "s1");
		myApplication.put("a1", "a1");
		return SUCCESS;
	}
}
